//
//  MacroClass.h
//  easyTaxi
//
//  Created by ellenpage on 13-4-1.
//  Copyright (c) 2013年 ellenpage. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MacroClass : NSObject

//----------ios系统相关-------

#define mVersion  [[[UIDevice currentDevice] systemVersion] floatValue]     //系统版本
#define mLanguage ([[NSLocale preferredLanguages] objectAtIndex:0])         //当前语言
#define mIsiPad   (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)    //是否是iPad
#define mIsiphone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)  //是否是iPhone
#define mIsiPhone5   ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)  //是否是iPhone5

//----------页面设计相关-------

#define mWindow   [[UIApplication sharedApplication] keyWindow] //window
#define mNavBar_Height 44 //导航栏高度
#define mScreen_Width  ([UIScreen mainScreen].bounds.size.width)  //屏幕宽
#define mScreen_Height ([UIScreen mainScreen].bounds.size.height) //屏幕高
#define mColor(RED,GREEN,BLUE) [UIColor colorWithRed:RED/255.0 green:GREEN/255.0 blue:BLUE/255.0 alpha:1.0]//颜色
#define mFont(name,fontSize)   [UIFont fontWithName:name size:fontSize] //自定义字体:名称/大小
#define mFont_System(fontSize) [UIFont systemFontOfSize:fontSize]       //系统字体:大小


//----------函数相关-----------

#define mUserDefaults                [NSUserDefaults standardUserDefaults]//字典
#define mLoadImg(name)               [UIImage imageNamed:name]//缓存中加载图片
#define mLoadImg_FromPath(file,type) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:file ofType:type]] //路径读取图片

//简单的以AlertView显示提示信息
#define mAlertView(title, msg) \
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:msg delegate:nil \
cancelButtonTitle:@"确定" \
otherButtonTitles:nil]; \
[alert show];

#define mRateUrl(appleID) [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",appleID]//评价地址

@end
